// 部门消息 
const express = require('express') 
const router = express.Router() 
const departmentHandler = require('../router_handle/department_msg.js')

// 获取部门消息id list
router.post('/getDepartmentMsg', departmentHandler.getDepartmentMsg)
// 获取部门消息
router.post('/getDepartmentMsgList', departmentHandler.getDepartmentMsgList)
// 返回用户的阅读列表及状态
router.post('/getReadListAndStatus', departmentHandler.getReadListAndStatus)

// 用户点击消息后,对read_list内的数据进行删减 参数 消息的readid 以及 用户的id
router.post('/clickDelete', departmentHandler.clickDelete)

// 把新发布文章的id插入到当前所属部门的用户的read_list中 
router.post('/changeUserReadList', departmentHandler.changeUserReadList)

// 把删除的文章的id从当前所属部门的用户的read_list中删除
router.post('/changeUserReadListButDelete', departmentHandler.changeUserReadListButDelete)
// 用户id 消息id 用户部门
router.post('/changeUserReadListButDeleteById', departmentHandler.changeUserReadListButDeleteById)

// 初始化, 根据部门找所有id 
router.post('/getIdByDep', departmentHandler.getIdByDep)
// 获取所有部门 全体成员
router.post('/setAllDepartment', departmentHandler.setAllDepartment)
// 删除 deleteId 全体成员
router.post('/deleteAllDepartment', departmentHandler.deleteAllDepartment)

module.exports = router